package fenyu.personblob.bean.strategy.user;

import fenyu.personblob.bean.databean.User;
import fenyu.personblob.bean.strategy.Strategy;
import fenyu.personblob.single.SinglePathDoor;

/**
 * create at 2018/12/22 9:08
 *
 * @author 纷羽 <gzj0078@gmail.com>
 */
public class ChangePasswordStrategy implements Strategy {

    @Override
    public Object todo(Object... args) {
        User person = (User) args[0];
        String new_password = (String) args[1];
        person.setPassword(new_password);
        SinglePathDoor.getSingleSave().getSaveDoor().getUserSavePath().save(person);
        return person;
    }
}
